//          https://ac.nowcoder.com/acm/problem/207376




class Solution
{
public:
    int minDifference(vector<int>& a)
    {
        sort(a.begin(), a.end());
        long long ans = 1e10;
        for (int i = 1; i < a.size(); i++)
            ans = min(ans, (long long)a[i] - a[i - 1]);

        return ans;
    }
};